package com.tomecode.ora.jdev.ext.showmepassword;

import oracle.ide.Ide;
import oracle.ide.controller.Command;
import oracle.ide.extension.RegisteredByExtension;

/**
 * @author Tomas (Tome) Frastia
 * @see http://www.tomecode.com
 * 
 * Command handler for com.tomecode.ora.jdev.ext.showmepasswordjdev.
 */
@RegisteredByExtension("com.tomecode.ora.jdev.ext.showmepasswordjdev")
public final class ShowMePasswordJdevCommand extends Command {
    public ShowMePasswordJdevCommand() {
        super(actionId());
    }

    public int doit() {
        return OK;
    }

    /**
     * Returns the id of the action this command is associated with.
     *
     * @return the id of the action this command is associated with.
     * @throws IllegalStateException if the action this command is associated
     *    with is not registered.
     */
    public static int actionId() {
        final Integer cmdId =
            Ide.findCmdID("com.tomecode.ora.jdev.ext.showmepasswordjdev");
        if (cmdId == null)
            throw new IllegalStateException("Action com.tomecode.ora.jdev.ext.showmepasswordjdev not found.");
        return cmdId;
    }
}
